import axios  from "axios";
export let getlist = ()=>{ // 异步的返回的是一个函数
    return (dispatch)=>{
        axios.get("/list").then(res=>{
            dispatch({
                type:"getlist",
                payload:res.data
            })
        })
    }
   
}
export let addshop = (item)=>{
 
    return {
        type:"addshop",
        payload:item
    }
}
export let addFn = (id)=>{
    console.log(id);
    return {
        type:"addFn",
        payload:id
    }
}
export let delFn = (id)=>{
    console.log(id);
    return {
        type:"delFn",
        payload:id
    }
}
export let checkAll = ()=> {
    return {
        type:"checkAll"
    }
}
export let checkitem = (id)=>{
    return {
        type:"checkitem",
        payload:id
    }
}
export let addressfn = (item)=>{
    return {
        type:"addressfn",
        payload:item
    }
}
export let delfnarress =(index)=>{
    return {
        type:"delfnarress",
        payload:index
    }
}
export let editaddressfn = (item)=>{
    return {
        type:"editaddressfn",
        payload:item
    }
}
export let getpulllist =(ispull)=>{
    return (dispatch)=>{
        axios.get("/pulllist").then(res=>{
            dispatch({
                type:"getpulllist",
                payload:res.data,
                ispull
            })
        })
    }
}
